import request from '@/utils/request'

// 查询退款单列表
export function listRefund(query) {
  return request({
    url: '/orderRefund/refund/list',
    method: 'get',
    params: query
  })
}

// 查询退款单详细
export function getRefund(id) {
  return request({
    url: '/orderRefund/refund/' + id,
    method: 'get'
  })
}

// 新增退款单
export function addRefund(data) {
  return request({
    url: '/orderRefund/refund',
    method: 'post',
    data: data
  })
}

// 修改退款单
export function updateRefund(data) {
  return request({
    url: '/orderRefund/refund',
    method: 'put',
    data: data
  })
}

// 删除退款单
export function delRefund(id) {
  return request({
    url: '/orderRefund/refund/' + id,
    method: 'delete'
  })
}

// 导出退款单
export function exportRefund(query) {
  return request({
    url: '/orderRefund/refund/export',
    method: 'get',
    params: query
  })
}

// 退款单审批
export function toApprove(data) {
  return request({
    url: '/orderRefund/refund/approve',
    method: 'post',
    data: data
  })
}

// 系统打款, 退款单打款接口
export function systemRefund(data) {
  return request({
    url: '/orderRefund/refund/remit',
    method: 'post',
    data: data
  })
}
